package com.jin.六大设计原则.迪米特法则.违背;

import java.util.ArrayList;
import java.util.List;

public class Teacher {
    private String name;
    private String clazz;
    private static List<Student> studentList;

    public Teacher() {
    }

    public Teacher(String name, String clazz) {
        this.name = name;
        this.clazz = clazz;
    }

    //在类加载的时候初始化
    static {
         studentList = new ArrayList<>();
         studentList.add(new Student("小明",10,589));
         studentList.add(new Student("小刚",54,356));
         studentList.add(new Student("小红",23,439));
         studentList.add(new Student("小靳",2,665));
         studentList.add(new Student("小李",19,502));
    }

    //静态方法
    public static List<Student>getStudentList(){
        return studentList;
    }

    public String getName() {
        return name;
    }

    public String getClazz() {
        return clazz;
    }

//    String a = test();
//
//    public String test(){
//        return "000";
//    }
}
